function createObj(F) {
  return Object.create(F.prototype);
}

function createObj(F) {
  let obj = {};
  Object.setPrototypeOf(obj, F.prototype);
  return obj;
}

function createObj(F) {
  function Fn() {}
  Fn.prototype = F.prototype;
  return new Fn();
}

function inherit(SubType, SuperType) {
  SubType.prototype = createObj(SuperType);

  Object.defineProperty(SubType.prototype, "constructor", {
    writable: true,
    enumerable: false,
    configurable: true,
    value: SubType,
  });
}

function Person(name, age) {
  this.name = name;
  this.age = age;
}

function Student(name, age, sex) {
  Person.call(this, name, age);
  this.sex = sex;
}

inherit(Student, Person);
